<template>
  <div class="sysconfig-comp-ct">
    <el-button type="primary" size="default" @click="print">打印</el-button>

    <el-table ref="tableData" :data="tableData" border style="width: 100%;margin-bottom: 20px;" id="printJS-form">
      <el-table-column prop="nodename" header-align="left" align="left" label="节点名称" width="106">
        <template slot-scope="scope">
          <div class="text-line-1" :title="scope.row.nodename">{{ scope.row.nodename }}</div>
        </template>
      </el-table-column>
      <el-table-column prop="devicename" header-align="left" align="left" label="设备名称">
        <template slot-scope="scope">
          <div class="text-line-1" :title="scope.row.devicename">{{ scope.row.devicename }}</div>
        </template>
      </el-table-column>
      <el-table-column prop="ipaddress" header-align="left" align="left" label="设备IP" width="118">
        <template slot-scope="scope">
          <div class="text-line-1" :title="scope.row.ipaddress">{{ scope.row.ipaddress }}</div>
        </template>
      </el-table-column>
      <el-table-column prop="mpname" header-align="left" align="left" label="资源名称">
        <template slot-scope="scope">
          <div class="text-line-1" :title="scope.row.mpname">{{ scope.row.mpname }}</div>
        </template>
      </el-table-column>
      <!-- <el-table-column prop="rolename" header-align="center" align="center" label="资源类型"></el-table-column> -->
      <el-table-column prop="alarmtype" header-align="left" align="left" label="告警类型" width="108">
        <template slot-scope="scope">
          <div class="text-line-1">
            {{ scope.row.alarmtype }}
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="alarmlevel" header-align="left" align="left" label="告警级别" width="104">
        <template slot-scope="scope">
          <div class="text-line-1">
            {{ scope.row.alarmlevel }}
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="alarmtime" header-align="left" align="left" label="产生时间" width="150">
        <template slot-scope="scope">
          <div class="text-line-1" :title="scope.row.alarmtime">{{ scope.row.alarmtime }}</div>
        </template>
      </el-table-column>
      <el-table-column prop="alarmdistime" header-align="left" align="left" label="恢复时间" width="150">
        <template slot-scope="scope">
          <div
            class="text-line-1"
            :title="
              scope.row.alarmdistime !== '2000-01-01 01:01:01' &&
              scope.row.alarmdistime !== '' &&
              scope.row.alarmdistime !== null
                ? scope.row.alarmdistime
                : ''
            "
          >
            {{
              scope.row.alarmdistime !== '2000-01-01 01:01:01' &&
              scope.row.alarmdistime !== '' &&
              scope.row.alarmdistime !== null
                ? scope.row.alarmdistime
                : ''
            }}
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="usestate" header-align="center" align="center" label="是否恢复" width="78">
        <template slot-scope="scope">
          <div
            :class="
              scope.row.alarmdistime !== '2000-01-01 01:01:01' &&
              scope.row.alarmdistime !== '' &&
              scope.row.alarmdistime !== null
                ? 'nouse'
                : 'used'
            "
          >
            {{
              scope.row.alarmdistime !== '2000-01-01 01:01:01' &&
              scope.row.alarmdistime !== '' &&
              scope.row.alarmdistime !== null
                ? '已恢复'
                : '未恢复'
            }}
          </div>
        </template>
      </el-table-column>

      <el-table-column prop="alarmaffirmusername" header-align="left" align="left" label="确认人" width="68">
        <template slot-scope="scope">
          <div class="text-line-1" :title="scope.row.alarmaffirmusername">{{ scope.row.alarmaffirmusername }}</div>
        </template>
      </el-table-column>
      <el-table-column prop="alarmaffirmtime" header-align="left" align="left" label="确认时间" width="150">
        <template slot-scope="scope">
          <div
            class="text-line-1"
            :title="
              scope.row.alarmaffirmtime !== '2000-01-01 01:01:01' &&
              scope.row.alarmaffirmtime !== '' &&
              scope.row.alarmaffirmtime !== null
                ? scope.row.alarmaffirmtime
                : ''
            "
          >
            {{
              scope.row.alarmaffirmtime !== '2000-01-01 01:01:01' &&
              scope.row.alarmaffirmtime !== '' &&
              scope.row.alarmaffirmtime !== null
                ? scope.row.alarmaffirmtime
                : ''
            }}
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="usestate" header-align="center" align="center" label="是否确认" width="78">
        <template slot-scope="scope">
          <div
            :class="
              scope.row.alarmaffirmtime !== '2000-01-01 01:01:01' &&
              scope.row.alarmaffirmtime !== '' &&
              scope.row.alarmaffirmtime !== null
                ? 'nouse'
                : 'used'
            "
          >
            {{
              scope.row.alarmaffirmtime !== '2000-01-01 01:01:01' &&
              scope.row.alarmaffirmtime !== '' &&
              scope.row.alarmaffirmtime !== null
                ? '已确认'
                : '未确认'
            }}
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="alarmclearusername" header-align="left" align="left" label="清除人" width="68">
        <template slot-scope="scope">
          <div class="text-line-1" :title="scope.row.alarmclearusername">{{ scope.row.alarmclearusername }}</div>
        </template>
      </el-table-column>
      <el-table-column prop="alarmcleartime" header-align="left" align="left" label="清除时间" width="150">
        <template slot-scope="scope">
          <div
            class="text-line-1"
            :title="
              scope.row.alarmcleartime !== '2000-01-01 01:01:01' &&
              scope.row.alarmcleartime !== '' &&
              scope.row.alarmcleartime !== null
                ? scope.row.alarmcleartime
                : ''
            "
          >
            {{
              scope.row.alarmcleartime !== '2000-01-01 01:01:01' &&
              scope.row.alarmcleartime !== '' &&
              scope.row.alarmcleartime !== null
                ? scope.row.alarmcleartime
                : ''
            }}
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="total" header-align="left" align="left" label="合并">
        <template slot-scope="scope">
          <div>
            <el-link @click="alarmTimeListHandle(scope.row)" style="color:#000;text-decoration:underline">
              {{ scope.row.changenum }}
            </el-link>
          </div>
        </template>
      </el-table-column>
      <el-table-column fixed="right" header-align="center" align="center" width="60" label="操作">
        <template slot-scope="scope">
          <el-tooltip content="详情" placement="top-start" effect="light">
            <span style="cursor:pointer" class="el-icon-search"></span>
          </el-tooltip>
          <!-- <el-button type="primary" size="mini" @click="alarmInfo(scope.row)">详情</el-button> -->
        </template>
      </el-table-column>
    </el-table>

    <graph-editor v-if="addOrUpdateVisible"></graph-editor>
  </div>
</template>
<script>
import print from 'print-js';
import graphEditor from '@/views/mxgraph/grapheditor.vue';
export default {
  components: { graphEditor },
  name: 'sysconfig',
  data() {
    return {
      tableData: [
        {
          id: 411,
          appsvrid: '570102A006000100',
          nodeaid: '00000000000000000000',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-测试间',
          deviceid: '5701032001000100',
          devicename: '示例2',
          mpid: '570103200100010006040102',
          mpname: '设备离线-01',
          alarmindex: '2022062416254200010706570103200100010006040102',
          alarmtype: '10706',
          alarmlevel: '02',
          alarmtime: '2022-06-24 16:25:42',
          alarmdistime: '2022-06-24 16:25:51',
          alarmvalue: '2',
          alarmaffirmuserid: '0000000000000000',
          alarmaffirmusername: 'admin',
          alarmaffirmtime: '2022-06-24 16:25:58',
          alarmclearuserid: '0000000000000000',
          alarmclearusername: 'admin',
          alarmcleartime: '2022-06-24 16:26:08',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: '',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.185',
          updatetime: '2022-06-24 16:26:28',
          changenum: null,
          alarmArchivingUserId: '57010230FEA09901',
          alarmArchivingUserName: '?',
          alarmArchivingTime: '2022-06-24 16:26:28',
          belonglocation: null
        },
        {
          id: 399,
          appsvrid: '570102A001000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-常德站',
          deviceid: '570102120100C401',
          devicename:
            '[渝厦高铁] K773+718 长沙西站东北角信号楼四层第一百一十一号通信机械室室内〔云台PTZ激光摄像机〕-196',
          mpid: '570102120500C401',
          mpname: '[渝厦高铁] K773+718 长沙西站东北角信号楼四层第一百一十一号通信机械室室内〔云台PTZ激光摄像机〕-196',
          alarmindex: '2022062414443600000401570102120500C401',
          alarmtype: '00401',
          alarmlevel: '04',
          alarmtime: '2022-06-24 14:44:36',
          alarmdistime: '2022-06-24 14:44:41',
          alarmvalue: '',
          alarmaffirmuserid: '57010230FEA09901',
          alarmaffirmusername: '?',
          alarmaffirmtime: '2022-06-24 16:13:03',
          alarmclearuserid: '57010230FEA09901',
          alarmclearusername: '?',
          alarmcleartime: '2022-06-24 16:13:05',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: '',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.138',
          updatetime: '2022-06-24 16:13:06',
          changenum: 0,
          alarmArchivingUserId: '57010230FEA09901',
          alarmArchivingUserName: '?',
          alarmArchivingTime: '2022-06-24 16:13:06',
          belonglocation: null
        },
        {
          id: 401,
          appsvrid: '570102A001000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-常德站',
          deviceid: '570102120100C501',
          devicename:
            '[渝厦高铁] K773+718 长沙西站东北角信号楼四层第一百一十一号通信机械室室内〔云台PTZ激光摄像机〕-197',
          mpid: '570102120500C501',
          mpname: '[渝厦高铁] K773+718 长沙西站东北角信号楼四层第一百一十一号通信机械室室内〔云台PTZ激光摄像机〕-197',
          alarmindex: '2022062414443600000401570102120500C501',
          alarmtype: '00401',
          alarmlevel: '04',
          alarmtime: '2022-06-24 14:44:36',
          alarmdistime: '2022-06-24 14:44:41',
          alarmvalue: '',
          alarmaffirmuserid: '0000000000000000',
          alarmaffirmusername: 'admin',
          alarmaffirmtime: '2022-06-24 16:16:23',
          alarmclearuserid: '',
          alarmclearusername: '',
          alarmcleartime: '2000-01-01 01:01:01',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: '',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.138',
          updatetime: '2022-06-24 16:16:26',
          changenum: 0,
          alarmArchivingUserId: '0000000000000000',
          alarmArchivingUserName: 'admin',
          alarmArchivingTime: '2022-06-24 16:16:26',
          belonglocation: null
        },
        {
          id: 403,
          appsvrid: '570102A001000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-常德站',
          deviceid: '570102120100C301',
          devicename:
            '[渝厦高铁] K773+718 长沙西站东北角信号楼四层第一百一十一号通信机械室室内〔云台PTZ激光摄像机〕-195',
          mpid: '570102120500C301',
          mpname: '[渝厦高铁] K773+718 长沙西站东北角信号楼四层第一百一十一号通信机械室室内〔云台PTZ激光摄像机〕-195',
          alarmindex: '2022062414443600000401570102120500C301',
          alarmtype: '00401',
          alarmlevel: '04',
          alarmtime: '2022-06-24 14:44:36',
          alarmdistime: '2022-06-24 14:44:41',
          alarmvalue: '',
          alarmaffirmuserid: '0000000000000000',
          alarmaffirmusername: 'admin',
          alarmaffirmtime: '2022-06-24 15:21:02',
          alarmclearuserid: '',
          alarmclearusername: '',
          alarmcleartime: '2000-01-01 01:01:01',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: '',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.138',
          updatetime: '2022-06-24 16:16:50',
          changenum: 0,
          alarmArchivingUserId: '0000000000000000',
          alarmArchivingUserName: 'admin',
          alarmArchivingTime: '2022-06-24 16:16:50',
          belonglocation: null
        },
        {
          id: 405,
          appsvrid: '570102A001000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-常德站',
          deviceid: '570102120100C601',
          devicename:
            '[渝厦高铁] K773+718 长沙西站东北角信号楼四层第一百一十一号通信机械室室内〔云台PTZ激光摄像机〕-198',
          mpid: '570102120500C601',
          mpname: '[渝厦高铁] K773+718 长沙西站东北角信号楼四层第一百一十一号通信机械室室内〔云台PTZ激光摄像机〕-198',
          alarmindex: '2022062414443600000401570102120500C601',
          alarmtype: '00401',
          alarmlevel: '04',
          alarmtime: '2022-06-24 14:44:36',
          alarmdistime: '2022-06-24 14:44:36',
          alarmvalue: '',
          alarmaffirmuserid: '0000000000000000',
          alarmaffirmusername: 'admin',
          alarmaffirmtime: '2022-06-24 16:16:54',
          alarmclearuserid: '0000000000000000',
          alarmclearusername: 'admin',
          alarmcleartime: '2022-06-24 16:17:02',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: '',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.138',
          updatetime: '2022-06-24 16:17:09',
          changenum: 0,
          alarmArchivingUserId: '0000000000000000',
          alarmArchivingUserName: 'admin',
          alarmArchivingTime: '2022-06-24 16:17:09',
          belonglocation: null
        },
        {
          id: 381,
          appsvrid: '570102A019000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-测试间',
          deviceid: '5701031203000101',
          devicename: '测试间-123 【定焦】',
          mpid: '5701031205000101',
          mpname: '测试间-123 【定焦】',
          alarmindex: '20220623130517000002025701031205000101',
          alarmtype: '00202',
          alarmlevel: '04',
          alarmtime: '2022-06-23 13:05:17',
          alarmdistime: '2022-06-23 13:05:21',
          alarmvalue: '',
          alarmaffirmuserid: '57010230FEA09904',
          alarmaffirmusername: '研发专用',
          alarmaffirmtime: '2022-06-23 13:45:33',
          alarmclearuserid: '57010230FEA09901',
          alarmclearusername: '?',
          alarmcleartime: '2022-06-24 15:08:02',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: 'objid=95370;;lv=1;lc=1',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.123',
          updatetime: '2022-06-24 15:08:04',
          changenum: 0,
          alarmArchivingUserId: '57010230FEA09901',
          alarmArchivingUserName: '?',
          alarmArchivingTime: '2022-06-24 15:08:04',
          belonglocation: null
        },
        {
          id: 385,
          appsvrid: '570102A019000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-测试间',
          deviceid: '5701031203000101',
          devicename: '测试间-123 【定焦】',
          mpid: '5701031205000101',
          mpname: '测试间-123 【定焦】',
          alarmindex: '20220623130407000002025701031205000101',
          alarmtype: '00202',
          alarmlevel: '04',
          alarmtime: '2022-06-23 13:04:07',
          alarmdistime: '2022-06-23 13:04:12',
          alarmvalue: '',
          alarmaffirmuserid: '57010230FEA09901',
          alarmaffirmusername: '?',
          alarmaffirmtime: '2022-06-24 15:10:15',
          alarmclearuserid: '57010230FEA09901',
          alarmclearusername: '?',
          alarmcleartime: '2022-06-24 15:10:17',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: 'objid=95070;;lv=1;lc=1',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.123',
          updatetime: '2022-06-24 15:10:19',
          changenum: 0,
          alarmArchivingUserId: '57010230FEA09901',
          alarmArchivingUserName: '?',
          alarmArchivingTime: '2022-06-24 15:10:19',
          belonglocation: null
        },
        {
          id: 383,
          appsvrid: '570102A019000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-测试间',
          deviceid: '5701031203000101',
          devicename: '测试间-123 【定焦】',
          mpid: '5701031205000101',
          mpname: '测试间-123 【定焦】',
          alarmindex: '20220623130326000002025701031205000101',
          alarmtype: '00202',
          alarmlevel: '04',
          alarmtime: '2022-06-23 13:03:26',
          alarmdistime: '2022-06-23 13:03:30',
          alarmvalue: '',
          alarmaffirmuserid: '57010230FEA09901',
          alarmaffirmusername: '?',
          alarmaffirmtime: '2022-06-24 15:08:06',
          alarmclearuserid: '57010230FEA09901',
          alarmclearusername: '?',
          alarmcleartime: '2022-06-24 15:08:08',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: 'objid=94820;;lv=1;lc=1',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.123',
          updatetime: '2022-06-24 15:08:10',
          changenum: 0,
          alarmArchivingUserId: '57010230FEA09901',
          alarmArchivingUserName: '?',
          alarmArchivingTime: '2022-06-24 15:08:10',
          belonglocation: null
        },
        {
          id: 391,
          appsvrid: '570102A019000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-测试间',
          deviceid: '5701031203000101',
          devicename: '测试间-123 【定焦】',
          mpid: '5701031205000101',
          mpname: '测试间-123 【定焦】',
          alarmindex: '20220623130321000002025701031205000101',
          alarmtype: '00202',
          alarmlevel: '04',
          alarmtime: '2022-06-23 13:03:21',
          alarmdistime: '2022-06-23 13:06:49',
          alarmvalue: '',
          alarmaffirmuserid: '57010230FEA09901',
          alarmaffirmusername: '?',
          alarmaffirmtime: '2022-06-24 16:05:02',
          alarmclearuserid: '57010230FEA09901',
          alarmclearusername: '?',
          alarmcleartime: '2022-06-24 16:05:19',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: 'objid=94450;;lv=1;lc=1',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.123',
          updatetime: '2022-06-24 16:05:37',
          changenum: 0,
          alarmArchivingUserId: '57010230FEA09901',
          alarmArchivingUserName: '?',
          alarmArchivingTime: '2022-06-24 16:05:37',
          belonglocation: null
        },
        {
          id: 393,
          appsvrid: '570102A019000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-测试间',
          deviceid: '5701031203000101',
          devicename: '测试间-123 【定焦】',
          mpid: '5701031205000101',
          mpname: '测试间-123 【定焦】',
          alarmindex: '20220623130317000002025701031205000101',
          alarmtype: '00202',
          alarmlevel: '04',
          alarmtime: '2022-06-23 13:03:17',
          alarmdistime: '2022-06-23 13:03:26',
          alarmvalue: '',
          alarmaffirmuserid: '0000000000000000',
          alarmaffirmusername: 'admin',
          alarmaffirmtime: '2022-06-24 16:06:00',
          alarmclearuserid: '0000000000000000',
          alarmclearusername: 'admin',
          alarmcleartime: '2022-06-24 16:06:02',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: 'objid=94730;;lv=1;lc=1',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.123',
          updatetime: '2022-06-24 16:06:04',
          changenum: 0,
          alarmArchivingUserId: '0000000000000000',
          alarmArchivingUserName: 'admin',
          alarmArchivingTime: '2022-06-24 16:06:04',
          belonglocation: null
        },
        {
          id: 377,
          appsvrid: '570102A019000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-测试间',
          deviceid: '5701031203000101',
          devicename: '测试间-123 【定焦】',
          mpid: '5701031205000101',
          mpname: '测试间-123 【定焦】',
          alarmindex: '20220623124615000002025701031205000101',
          alarmtype: '00202',
          alarmlevel: '04',
          alarmtime: '2022-06-23 12:46:15',
          alarmdistime: '2022-06-23 12:46:18',
          alarmvalue: '',
          alarmaffirmuserid: '57010230FEA09901',
          alarmaffirmusername: '?',
          alarmaffirmtime: '2022-06-24 13:59:22',
          alarmclearuserid: '57010230FEA09901',
          alarmclearusername: '?',
          alarmcleartime: '2022-06-24 13:59:24',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: 'objid=90640;;lv=1;lc=1',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.123',
          updatetime: '2022-06-24 13:59:26',
          changenum: 0,
          alarmArchivingUserId: '57010230FEA09901',
          alarmArchivingUserName: '?',
          alarmArchivingTime: '2022-06-24 13:59:26',
          belonglocation: null
        },
        {
          id: 369,
          appsvrid: '570102A019000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-测试间',
          deviceid: '5701031203000101',
          devicename: '测试间-123 【定焦】',
          mpid: '5701031205000101',
          mpname: '测试间-123 【定焦】',
          alarmindex: '20220623103026000002025701031205000101',
          alarmtype: '00202',
          alarmlevel: '04',
          alarmtime: '2022-06-23 10:30:26',
          alarmdistime: '2022-06-23 10:30:30',
          alarmvalue: '',
          alarmaffirmuserid: '57010230FEA09901',
          alarmaffirmusername: '?',
          alarmaffirmtime: '2022-06-23 11:10:13',
          alarmclearuserid: '57010230FEA09901',
          alarmclearusername: '?',
          alarmcleartime: '2022-06-23 11:10:42',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: 'objid=78880;;lv=1;lc=1',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.123',
          updatetime: '2022-06-23 11:21:54',
          changenum: 0,
          alarmArchivingUserId: '57010230FEA09901',
          alarmArchivingUserName: '?',
          alarmArchivingTime: '2022-06-23 11:21:54',
          belonglocation: null
        },
        {
          id: 371,
          appsvrid: '570102A019000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-测试间',
          deviceid: '5701031203000101',
          devicename: '测试间-123 【定焦】',
          mpid: '5701031205000101',
          mpname: '测试间-123 【定焦】',
          alarmindex: '20220623102844000002025701031205000101',
          alarmtype: '00202',
          alarmlevel: '04',
          alarmtime: '2022-06-23 10:28:44',
          alarmdistime: '2022-06-23 10:28:49',
          alarmvalue: '',
          alarmaffirmuserid: '57010230FEA09901',
          alarmaffirmusername: '?',
          alarmaffirmtime: '2022-06-23 11:10:34',
          alarmclearuserid: '57010230FEA09901',
          alarmclearusername: '?',
          alarmcleartime: '2022-06-23 11:12:32',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: 'objid=78730;;lv=1;lc=1',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.123',
          updatetime: '2022-06-23 11:21:56',
          changenum: 0,
          alarmArchivingUserId: '57010230FEA09901',
          alarmArchivingUserName: '?',
          alarmArchivingTime: '2022-06-23 11:21:56',
          belonglocation: null
        },
        {
          id: 365,
          appsvrid: '570102A019000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-测试间',
          deviceid: '5701031203000101',
          devicename: '测试间-123 【定焦】',
          mpid: '5701031205000101',
          mpname: '测试间-123 【定焦】',
          alarmindex: '20220622180124000002025701031205000101',
          alarmtype: '00202',
          alarmlevel: '04',
          alarmtime: '2022-06-22 18:01:24',
          alarmdistime: '2022-06-22 18:01:30',
          alarmvalue: '',
          alarmaffirmuserid: '57010230FEA09901',
          alarmaffirmusername: '?',
          alarmaffirmtime: '2022-06-22 18:03:01',
          alarmclearuserid: '57010230FEA09901',
          alarmclearusername: '?',
          alarmcleartime: '2022-06-22 18:03:07',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: 'objid=28550;;lv=1;lc=1',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.123',
          updatetime: '2022-06-22 18:03:08',
          changenum: 0,
          alarmArchivingUserId: '57010230FEA09901',
          alarmArchivingUserName: '?',
          alarmArchivingTime: '2022-06-22 18:03:08',
          belonglocation: null
        },
        {
          id: 387,
          appsvrid: '570102A004000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-测试间',
          deviceid: '5701031203000501',
          devicename: '250.120',
          mpid: '5701031205000501',
          mpname: '250.120',
          alarmindex: '20220622171418000001065701031205000501',
          alarmtype: '00106',
          alarmlevel: '02',
          alarmtime: '2022-06-22 17:14:18',
          alarmdistime: '2022-06-23 09:00:05',
          alarmvalue: '21',
          alarmaffirmuserid: '57010230FEA09901',
          alarmaffirmusername: '?',
          alarmaffirmtime: '2022-06-24 16:01:48',
          alarmclearuserid: '57010230FEA09901',
          alarmclearusername: '?',
          alarmcleartime: '2022-06-24 16:02:11',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: '',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.120',
          updatetime: '2022-06-24 16:02:27',
          changenum: 0,
          alarmArchivingUserId: '57010230FEA09901',
          alarmArchivingUserName: '?',
          alarmArchivingTime: '2022-06-24 16:02:27',
          belonglocation: null
        },
        {
          id: 353,
          appsvrid: '570102A019000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-测试间',
          deviceid: '5701031203000101',
          devicename: '测试间-123 【定焦】',
          mpid: '5701031205000101',
          mpname: '测试间-123 【定焦】',
          alarmindex: '20220622165725000002025701031205000101',
          alarmtype: '00202',
          alarmlevel: '04',
          alarmtime: '2022-06-22 16:57:25',
          alarmdistime: '2022-06-22 16:57:30',
          alarmvalue: '',
          alarmaffirmuserid: '57010230FEA09901',
          alarmaffirmusername: '?',
          alarmaffirmtime: '2022-06-22 16:59:49',
          alarmclearuserid: '57010230FEA09901',
          alarmclearusername: '?',
          alarmcleartime: '2022-06-22 16:59:53',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: 'objid=21820;;lv=1;lc=1',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.123',
          updatetime: '2022-06-22 16:59:56',
          changenum: 0,
          alarmArchivingUserId: '57010230FEA09901',
          alarmArchivingUserName: '?',
          alarmArchivingTime: '2022-06-22 16:59:56',
          belonglocation: null
        },
        {
          id: 357,
          appsvrid: '570102A019000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-测试间',
          deviceid: '5701031203000101',
          devicename: '测试间-123 【定焦】',
          mpid: '5701031205000101',
          mpname: '测试间-123 【定焦】',
          alarmindex: '20220622165033000002025701031205000101',
          alarmtype: '00202',
          alarmlevel: '04',
          alarmtime: '2022-06-22 16:50:33',
          alarmdistime: '2022-06-22 16:50:37',
          alarmvalue: '',
          alarmaffirmuserid: '57010230FEA09901',
          alarmaffirmusername: '?',
          alarmaffirmtime: '2022-06-22 17:00:23',
          alarmclearuserid: '57010230FEA09901',
          alarmclearusername: '?',
          alarmcleartime: '2022-06-22 17:10:06',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: 'objid=21240;;lv=1;lc=1',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.123',
          updatetime: '2022-06-22 17:10:13',
          changenum: 0,
          alarmArchivingUserId: '57010230FEA09901',
          alarmArchivingUserName: '?',
          alarmArchivingTime: '2022-06-22 17:10:13',
          belonglocation: null
        },
        {
          id: 361,
          appsvrid: '570102A019000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-测试间',
          deviceid: '5701031203000101',
          devicename: '测试间-123 【定焦】',
          mpid: '5701031205000101',
          mpname: '测试间-123 【定焦】',
          alarmindex: '20220622165018000002025701031205000101',
          alarmtype: '00202',
          alarmlevel: '04',
          alarmtime: '2022-06-22 16:50:18',
          alarmdistime: '2022-06-22 16:50:21',
          alarmvalue: '',
          alarmaffirmuserid: '57010230FEA09901',
          alarmaffirmusername: '?',
          alarmaffirmtime: '2022-06-22 17:06:29',
          alarmclearuserid: '57010230FEA09901',
          alarmclearusername: '?',
          alarmcleartime: '2022-06-22 17:10:05',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: 'objid=21000;;lv=1;lc=1',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.123',
          updatetime: '2022-06-22 17:10:22',
          changenum: 0,
          alarmArchivingUserId: '57010230FEA09901',
          alarmArchivingUserName: '?',
          alarmArchivingTime: '2022-06-22 17:10:22',
          belonglocation: null
        },
        {
          id: 359,
          appsvrid: '570102A019000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-测试间',
          deviceid: '5701031203000101',
          devicename: '测试间-123 【定焦】',
          mpid: '5701031205000101',
          mpname: '测试间-123 【定焦】',
          alarmindex: '20220622164916000002025701031205000101',
          alarmtype: '00202',
          alarmlevel: '04',
          alarmtime: '2022-06-22 16:49:16',
          alarmdistime: '2022-06-22 16:49:23',
          alarmvalue: '',
          alarmaffirmuserid: '57010230FEA09901',
          alarmaffirmusername: '?',
          alarmaffirmtime: '2022-06-22 17:09:57',
          alarmclearuserid: '57010230FEA09901',
          alarmclearusername: '?',
          alarmcleartime: '2022-06-22 17:10:04',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: 'objid=20630;;lv=1;lc=1',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.123',
          updatetime: '2022-06-22 17:10:17',
          changenum: 0,
          alarmArchivingUserId: '57010230FEA09901',
          alarmArchivingUserName: '?',
          alarmArchivingTime: '2022-06-22 17:10:17',
          belonglocation: null
        },
        {
          id: 351,
          appsvrid: '570102A019000100',
          nodeaid: '',
          nodeaname: '',
          nodename: '广铁集团(57)-长益常下级节点-测试间',
          deviceid: '5701031203000101',
          devicename: '测试间-123 【定焦】',
          mpid: '5701031205000101',
          mpname: '测试间-123 【定焦】',
          alarmindex: '20220622164508000002025701031205000101',
          alarmtype: '00202',
          alarmlevel: '04',
          alarmtime: '2022-06-22 16:45:08',
          alarmdistime: '2022-06-22 16:45:13',
          alarmvalue: '',
          alarmaffirmuserid: '57010230FEA09901',
          alarmaffirmusername: '?',
          alarmaffirmtime: '2022-06-22 16:48:06',
          alarmclearuserid: '57010230FEA09901',
          alarmclearusername: '?',
          alarmcleartime: '2022-06-22 16:51:50',
          alarmreportuserid: '',
          alarmreportusername: '',
          alarmdsp: 'objid=20080;;lv=1;lc=1',
          worderid: '',
          groupnodecode: '',
          timeinfo: null,
          ipaddress: '192.168.250.123',
          updatetime: '2022-06-22 16:51:54',
          changenum: 0,
          alarmArchivingUserId: '57010230FEA09901',
          alarmArchivingUserName: '?',
          alarmArchivingTime: '2022-06-22 16:51:54',
          belonglocation: null
        }
      ],
      addOrUpdateVisible: false
    };
  },
  mounted() {},
  methods: {
    edit(row) {
      console.log(row);
      this.addOrUpdateVisible = true;
    },
    print() {
      const html = document.querySelector('#printJS-form').innerHTML;
      // 新建一个 DOM
      const div = document.createElement('div');
      const printDOMID = 'printDOMElement';
      div.id = printDOMID;
      div.innerHTML = html;

      // 提取第一个表格的内容 即表头
      const ths = div.querySelectorAll('.el-table__header-wrapper th');
      const ThsTextArry = [];
      for (let i = 0, len = ths.length; i < len; i++) {
        if (ths[i].innerText !== '') ThsTextArry.push(ths[i].innerText);
      }

      // 删除多余的表头
      div.querySelector('.hidden-columns').remove();
      // 第一个表格的内容提取出来后已经没用了 删掉
      div.querySelector('.el-table__header-wrapper').remove();

      // 将第一个表格的内容插入到第二个表格
      let newHTML = '<tr>';
      for (let i = 0, len = ThsTextArry.length; i < len; i++) {
        newHTML += '<td style="text-align: center; font-weight: bold">' + ThsTextArry[i] + '</td>';
      }

      newHTML += '</tr>';
      div.querySelector('.el-table__body-wrapper table').insertAdjacentHTML('afterbegin', newHTML);
      // 将新的 DIV 添加到页面 打印后再删掉
      document.querySelector('body').appendChild(div);

      printJS({
        printable: printDOMID,
        type: 'html',
        scanStyles: false,
        style: 'table tr td,th { border-collapse: collapse;padding: 15px;border:1px #000 solid; }' // 表格样式
      });

      div.remove();
    }
  }
};
</script>
<style lang="scss" scoped>
.sysconfig-comp-ct {
  position: relative;
  height: 100%;

  .text-line-1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
</style>
